<?
        require_once('../../Inc/Global.php');
        require_once('CategoryData.php');
        $result = GetCategories();
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="../../ECommSite/ECommCss.css" />
<title>Category Index</title>
</head>
<body>
<table border="1">
                        <tr>
                                <th>Actions</th>
                                <th>Category Name</th>
                               
                        </tr>
       
        <? while($rs = $result->fetch_assoc()){ ?>
                <tr>
                        <td>
                                <a href="View.php?ID=<?=$rs['ID']?>">View</a>
                                <a href="EditCategory.php?ID=<?=$rs['ID']?>">Edit</a>
                                <a href="Delete.php?ID=<?=$rs['ID']?>">Delete</a>
                               
                        </td>
                        <td><?=$rs['Name']?></td>
                        
                </tr>  
       
        <? } ?>
       
</table>
<a href="EditCategory.php"><b>Click here to add a new category.</b></a>
<br />
<input type="button" value="Go Back" onclick="window.location.href='http://cs.newpaltz.edu/~N00001387/WebClass/DatabaseProject/'" />
</body>
</html>

